@import "@../../style/icon";
@import "@../../style/common";

.popup-wrapper {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;

  &.show {
    opacity: 1;
    visibility: visible;

    .popup {
      transform: translateY(0);
    }
  }

  .popup {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5000;

    overflow: hidden;

    min-height: 25%;
    padding: 0 24px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;

    background-color: #fff;

    line-height: 1.4;

    transition: all 0.3s;
    transform: translateY(100%);

    @media (prefers-color-scheme: dark) {
      background-color: #1c1c1e;
    }
  }
}

.popup-head {
  display: flex;
  align-items: center;
  height: 8em;
  font-size: 8px;

  .icon-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transform: translateY(-50%);
  }
}

.popup-head-button {
  position: relative;
  left: -8px;
}

.popup-head-title {
  flex: 1;

  .title {
    display: block;
    color: var(--text-color);
    font-weight: 700;
    font-size: 15px;
  }

  .subtitle {
    display: block;
    color: var(--grey);
    font-size: 10px;
  }
}

.popup-head-button + .popup-head-title {
  padding: 0 40px;
  text-align: center;
}

.popup-head-title + .popup-head-button {
  right: -8px;
  left: auto;
}

.popup-head-title + .popup-head-button .icon-button {
  right: 0;
}

.popup-body {
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;

  max-height: 50vh;

  word-wrap: break-word;
  hyphens: auto;

  .text {
    padding-top: 4px;

    color: var(--text-color);

    font-weight: 700;
    font-size: 17px;
    line-height: 1.4;
  }

  .desc {
    padding-top: 16px;
    color: var(--light-grey);
    font-size: 14px;
    line-height: 1.4;
  }
}

.popup-foot {
  padding: 40px 24px 32px;
  text-align: center;

  .button:nth-last-child(n + 2),
  .button:nth-last-child(n + 2) + .button {
    display: inline-block;
    vertical-align: top;
    width: 120px;
    margin: 0 8px;
  }
}
